import request from '../utils/request'
import config from '../utils/config'
import { splitStr } from './common'



// 通用图片上传
// 上传类型：avatar--头像上传；common--通用上传；
// 允许值: "common", "avatar"
export function upload(data) {
  let urlStr = '/upload/common'
  const url = process.env.NODE_ENV === 'production' ? config.BaseUrl + urlStr : urlStr;
  return request({
    url,
    method: 'post',
    data: data
  })
}